<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      // if (true) {
      //   // a = 1;
      //   console.log(a);
      //   let a;
      // }

      function fn() {
        // https://tc39.es/ecma262/#sec-declarations-and-the-variable-statement
        // 实际let和const定义的量，是有提升的
        // 只是在到达变量定义之前，没办法访问
        debugger;
        console.log(a);
        let a = 1;
      }
      fn();
    </script>
  </body>
</html>
